package com.sky.mapper;

import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface ShoppingCarMapper {

    void insert(ShoppingCart shoppingCart);


    List<ShoppingCart> getShoppingCartList(ShoppingCart shoppingCart);

    @Select("select * from shopping_cart where user_id = #{userId}")
    List<ShoppingCart> list(Long userId);

    @Delete("delete from shopping_cart where user_id = #{userId}")
    void delet(Long userId);

    Long getShoppingCartSetmealCount(Long id, Long userId);

    Long getShoppingCartDishCount(Long id, Long userId);


    void update(ShoppingCart shoppingCart);

    void deleteDishOne(Long dishId, Long userId);

//    @Delete("delete  from shopping_cart where setmeal_id = #{id} and user_id = #{userId}")
    void deleteSetmealOne(Long setmealId, Long userId);

    void delete(ShoppingCart shoppingCart);
}
